<%-- 
    Document   : ThemBanTin
    Created on : Nov 16, 2012, 10:37:29 PM
    Author     : NGUYEN DANG
--%>

<%@page import="All.utility.UserManagerProperties"%>
<%@page import="All.DTO.AccountBean"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.PreparedStatement"%>
<%@page import="java.sql.DriverManager"%>
<%@page import="java.sql.Connection"%>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%
    AccountBean user = (AccountBean) session.getAttribute("UserBean");
        if ((user == null) || (!user.getRole().equals(UserManagerProperties.ADMIN_ROLE))) {
                response.sendRedirect("./DangNhap.jsp");
        }
%>

<!DOCTYPE html>
<html>
    <head>
        <title>Insert News</title>
        <meta name="description" content="website description" />
        <meta name="keywords" content="website keywords, website keywords" />
        <link rel="stylesheet" type="text/css" href="./css/style.css" />
        <!-- modernizr enables HTML5 elements and feature detects -->
        <script type="text/javascript" src="./js/modernizr-1.5.min.js"></script>
        <script type="text/javascript" src="./editor/ckeditor.js" ></script>
    </head>    
    <body>
        <div id="main">
            <header>
                <jsp:include page="./file/header.jsp"></jsp:include>
            </header>
            <div id="site_content">
                <jsp:include page="./file/LeftMenu.jsp"></jsp:include>
                <div class="content">
                    <form name="demo" action="./InsertNewsServlet" method="POST">
                            <table border="0" cellpadding="0" cellspacing="0" align="center">
                                <tr>
                                        <td>Tiêu Đề : </td><td><input type="text" name="txtTieude" id="txtTieude" size="40"/></td>
                                </tr>
                                <tr>
                                        <td>Tóm Tắt Nội Dung : </td><td><input type="text" name="txtTomtat" id="txtTomtat" size="40"/></td>
                                </tr>
                                <tr>
                                        <td>Nội Dung : </td><td><textarea name="txtNoidung" id="txtnoidung" rows="10" cols="40"></textarea></td>
                                </tr>
                                <script>
                                    CKEDITOR.replace( 'txtnoidung' );                                   
                                </script>
                                <tr>
                                    <td>Hình Ảnh : </td><td><input type="file" name="txtHinhanh" value="" rows="10" cols="40"/></td>
                                </tr>
                                <tr>
                                        <td>Thể Loại : </td><td><input type="text" name="txtTheloai" id="txtTheloai" size="40"/></td>
                                </tr>
                                <tr>
                                        <td>Người Đăng : </td><td><input type="text" name="txtNguoidang" id="txtNguoidang" size="40"/></td>
                                </tr>
                                <tr>
                                        <td>&nbsp;</td>
                                        <td>
                                            <input type="submit"  name="btnok" id="btnok" value="Insert"/>
                                            <input type="button" value="Back" onclick="javascript:history.back()" />
                                        </td>
                                </tr>
                            </table>
                    </form>
                </div>
            </div>           
            <footer>
                <jsp:include page="./file/footer.jsp"></jsp:include>
            </footer>
        </div>
        <p>&nbsp;</p>
  <!-- javascript at the bottom for fast page loading -->
  <script type="text/javascript" src="./js/jquery.js"></script>
  <script type="text/javascript" src="./js/jquery.easing-sooper.js"></script>
  <script type="text/javascript" src="./js/jquery.sooperfish.js"></script>
  <script type="text/javascript" src="./js/image_fade.js"></script>
  <script type="text/javascript">
    $(document).ready(function() {
      $('ul.sf-menu').sooperfish();
    });
  </script>
    </body>
</html>

